<%@ page isELIgnored="false" %><%@ page session="false" %><%@ page contentType="text/xml; charset=UTF-8" %><%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %><%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %><%@ taglib prefix="spring" uri="http://www.springframework.org/tags/spring" %><%@ page pageEncoding="UTF-8"%><flatAds><c:forEach var="flatAd" items="${flatAds}" varStatus="status">
<c:if test="${not empty flatAd}">
  <flatAd>
    <city>${flatAd.city}</city>
    <address><c:out value="${flatAd.street}"
      /><c:if test="${not empty flatAd.building}">, <c:out value="${flatAd.building}"/></c:if></address>
    <date><fmt:formatDate value="${flatAd.lastPublishingDate}" pattern="dd.MM.yyyy"/></date>
    <rating>${normalizedRatings[status.count - 1]}</rating>
    <agent>${flatAd.agent}</agent>
    <phone>${flatAd.phone}</phone>
    <price>${flatAd.price}</price>
    <room>${flatAd.room}</room>
    <description><c:out value="${flatAd.description}"/></description>
    <images><c:forEach var="flatImage" items="${flatAd.flatImages}">
      <image id="${flatImage.id}"/></c:forEach>
    </images>
    <c:if test="${not empty flatAd.geoLocation}">
      <lat>${flatAd.geoLocation.lat}</lat>
      <lon>${flatAd.geoLocation.lon}</lon>
    </c:if>
    <c:if test="${(not empty flatAd.agentUserReviewCount) && flatAd.agentUserReviewCount > 0}">
      <agentUserReviewCount>${flatAd.agentUserReviewCount}</agentUserReviewCount>
    </c:if>
    <c:if test="${(not empty flatAd.badPhoneUserReviewCount) && flatAd.badPhoneUserReviewCount > 0}">
      <badPhoneUserReviewCount>${flatAd.badPhoneUserReviewCount}</badPhoneUserReviewCount>
    </c:if>
    <c:if test="${(not empty flatAd.expiredAdUserReviewCount) && flatAd.expiredAdUserReviewCount > 0}">
      <expiredAdUserReviewCount>${flatAd.expiredAdUserReviewCount}</expiredAdUserReviewCount>
    </c:if>
  </flatAd></c:if></c:forEach>
</flatAds>